home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Collections: Scope
/
Scope Disk #010 (199x)(Scope PD)(US)[WB].zip
/
Scope Disk #010 (199x)(Scope PD)(US)[WB].adf
/
Ixecute
/
ixecute.doc
< prev
next >
Wrap
Text File
|
1988-05-18
|
4KB
|
89 lines
Well, here it is: my first C program.
What I wanted to do was put together a "killer demo" to impress my
friends with my new Amiga's great graphics and sound. Not having the
slightest idea how to do that, I thought I'd put a couple of canned
things together. On my system, the "execute" file looked like this:
cd dh0:paint.stuff/animation
run showanim -c +2 TELLSTAR-ONE
cd :tools/sounds/thriller
run led
wait 14
run play thriller
Now on my system at least, that would fire up a nifty anim I'd downloaded
from CServe, plus a PD Sonix-player and a great rendition of "thriller"
that a local BBS provided. With the "wait 14" in there, the two would
come up simultaneously and blow everybody's socks off.
Trouble was, I had to launch the damn thing from CLI. All these neat
icons, and to make the machine do anything serious I had to type magic
incantations into a text window. Some demo.
Now, there may be a way to make a script like that execute from an
icon, but I couldn't find out what it is. The few things I downloaded
that sounded right turned out to have serious limitations: I had to
type the lines into an icon INFO window (one of the more sophisticated
text editors, don't you know), or "cd" wouldn't work, or.....
Which is how Ixecute came to be.
Ixecute can be named the default tool for any "project" icon. When the
icon is clicked, the text file associated with it gets executed. Period.
No games. My killer demo script works! Ixecute will even "run Pyro"
without leaving a window hanging around!
Using Ixecute is simple. Use your favorite text editor to create a CLI
script. Test it by executing it. When it works, take a handy "project"
icon and give it the same name, with a .info extension. Open the INFO
window and make the default tool Ixecute. (Depending on where you PUT
Ixecute, you may have to make it "SYS:c/Ixecute" or something like
that, but you get the idea). Double-click and away you go!
Expert mode:
For reasons unclear, new CLI's wake up with their current directory
set to df0:, even when SYS: is a hard drive or dfn:. To make things
easy for script writers, Ixecute allows for this: it does not pass the
actual script file to the CLI it creates; it really passes a file called
ixec.temp that it creates in the SYS:t directory (and deletes on its way
out, so you'll never see it). The file ixec.temp contains the
line "cd SYS:", then your script, and then the line "endcli". If you
promise to be good, Ixecute will bypass the temp file and directly
execute your script file. If you forget to "cd" to your destination,
or fail to "endcli", don't blame Ixecute for what happens. You "promise
to be good" by typing the word "expert" into the Tool Types field in the
icon's INFO window.
I want you to know that adding that feature cost me several hours of
sleep. If I'd just said in the docs: make sure you start with a "cd"
and end with an "endcli", I wouldn't have needed it. If I'd just made
everybody use the temp file, I wouldn't have needed it. But no -- my
first C program was on a roll and I just HAD to figure out how to read
that damn Tool Types field from inside a program three directories away.
And having figured that out, I'm LEAVING THE FEATURE IN, even though
bypassing the temp file only saves about 1.5 seconds.
The inevitable Legal Stuff:
Copyright 1988, Benson the Dog. Placed into the public domain by the
author, who assumes no liability for its use or abuse. No warranties!
If you use this program and you crash your system and lose six months of
accounts receivable records, tough. You were warned: unattended CLI
scripts can wreak havoc (you mean I typed "delete dh0:#?" ????).
To those paranoid about viruses:
I put the source code in the arc file. It was written for Lattice 4.0,
but you Manx hackers can probably make it run. The best protection
against viri is to only run things you compiled yourself from source
you read youself. (Now watch some twit put a virus in the next rev of
the compiler.)
Bob Hahn
April 26, 1988
Cserve 70535,542
Source TCU504